.SearchBar {
  grid-area: search;
  width: 100%;
  position: relative;
  display: inline-flex;
  background: var(--search-bar-background, var(--input-background));
  border-radius: var(--space-md);
  padding: var(--space-xs);

  &:focus-within {
    box-shadow: 0px 0px 0px 3px
      var(--search-bar-border, var(--input-backgroundd));
  }

  .autoComplete {
    position: absolute;
    top: 75%;
    max-height: 200px;
    width: 100%;
    background-color: var(--input-background);
    overflow: auto;
    list-style: none;
    margin: -2px -8px;
    display: none;
    padding: var(--space-xs) var(--space-md);
    text-align: start;
    overflow-x: hidden;
    z-index: 1;
    border-bottom-left-radius: var(--space-md);
    border-bottom-right-radius: var(--space-md);

    li {
      padding: 2px 0px;

      span {
        opacity: 0.3;
      }

      &:hover {
        background-color: var(--accent);
        color: var(--background);
      }
    }
  }

  &:focus-within ul.autoComplete {
    display: block;
  }

  ul.autoComplete:empty {
    display: none;
  }

  .searchButton {
    padding: var(--space-2xs) var(--space-2xs) 0 var(--space-2xs);
  }

  .clearSearchButton {
    padding-inline-end: var(--space-sm);
    transition: color 250ms;
    background: transparent;
    border: none;
    color: var(--text-secondary);

    svg {
      cursor: pointer;
    }
  }

  .searchBarInput {
    width: 100%;
    appearance: none;
    background: transparent;
    font: var(--font-secondary-bold);
    padding: 0 var(--space-2xs);
    border: none;
    outline: none;
    transition: color 250ms;
    color: var(--text-secondary);

    &::placeholder {
      opacity: 0.8;
    }
  }
}
